
<template>
    <vo-table ref="yuTable" :data="data.tableData.data" :cols="data.tableData.cols" :config="data.tableData.config" @fetch-data="query" @vue:mounted="query" >
      <template #leftBar>
        <tiny-input v-model="data.searchData.codeLike" placeholder="code"></tiny-input>
        <tiny-input v-model="data.searchData.nameLike" placeholder="名称"></tiny-input>
        <tiny-input v-model="data.searchData.tagLike" placeholder="tag"></tiny-input>
        <tiny-button  size="small" ghost type="info" @click="query"  ><vo-icon iconName="sousuo"  ></vo-icon>查询</tiny-button>
        </template>
        <template #rightBar>

        </template>
          <tiny-button-group class="ml-4">
            <tiny-button ghost type="success" size="small"  @click="addDict"><vo-icon iconName="add" ></vo-icon>新增</tiny-button>
        </tiny-button-group>

        <template v-slot:handleSlot="{row}">
        <tiny-button-group class="ml-4">
          <tiny-button size="mini" ghost type="success" @click="editBtn(row)">编辑</tiny-button>
          <tiny-button size="mini" ghost type="danger" @click="delRuleSet(row)">删除 </tiny-button>
        </tiny-button-group>
      </template>
           
    </vo-table>
</template>
<script setup>
  import {reactive, ref, getCurrentInstance,onMounted} from 'vue';  
  const {proxy} = getCurrentInstance();
  const data = reactive({
    tableData: {  data: {}, cols: [],  config: {} },
    searchData: {  codeLike: '',  nameLike: '',  tagLike: '',index: 0,pageSize: 10},
  })
  const yuTable = ref(null);
  data.tableData.data = []
  data.tableData.cols = [
    {type: 'index',title: '序号'},
    {title: '编码', key: 'code', align: 'left'},
    {title: '名称', key: 'name', align: 'left'},
    {title: '创建时间', key: 'gmtCreateStr', align: 'left'},
    {title: '修改时间', key: 'gmtModifiedStr', align: 'left'},
    {title: '状态', key: 'statusStr', align: 'left'},
    {title: '创建人', key: 'creatorShowName', align: 'left'},
    {title: '修改人', key: 'modifierShowName', align: 'left'},
    { title: '操作', align: 'center', slot: 'handleSlot',  },
]
const query = ()=>{
      // let params = {dictInfo:data.dictInfo};
    var page = {page:yuTable.value.page()};
    let params = Object.assign({}, data.searchData,page);
    proxy.$api.taskJob.querySpaceList(params).then(res=>{
      data.tableData.data = res

    })
}
</script>

<style lang="scss" scoped>



</style>